The Adaptive Proportional Derivative Algorithm